<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('store/index')}">门店列表</a></li>
			<li><a href="{:url('store/add')}">门店添加</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="get" action="{:url('store/index')}">
            门店名称:
            <input type="text" class="form-control" name="name" style="width: 220px;" value="{:input('request.name/s','')}">
            门店地址:
            <input type="text" class="form-control" name="address" style="width: 220px;" value="{:input('request.address/s','')}">
            业务员:
            <select class="form-control" name="salesman_id">
            	<option value=""></option>
            	<foreach name="salesman_list" item="vo">
            		<option value="{$vo.id}" <if $vo.id == input('salesman_id')>selected</if> >{$vo.name}</option>
            	</foreach>
            </select>
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:url('store/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>门店名称</th>
					<th>门店地址</th>
					<th>门店余额</th>
					<th>归属业务员</th>
					<th>状态</th>
					<th width="240">{:lang('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="list" item="vo">
				<tr>
					<td>{$vo.id}</td>
					<td>{$vo.name}</td>
					<td>{$vo.address}</td>
					<td>{$vo.coin}</td>
					<td>{$vo.salesman.name|default=''}|{$vo.salesman.mobile|default=''}</td>
					<td><if $vo.delete_time>关闭<else/>营业</if></td>
					<td>
						<a class="btn btn-xs btn-primary" href="javascript:parent.openIframeLayer('{:url('store_account/index',array('store_id'=>$vo['id']))}','门店账号',{area: ['700px', '600px']});">门店账号</a>
						<a class="btn btn-xs btn-primary" href="javascript:parent.openIframeLayer('{:url('store/promotion_list',array('store_id'=>$vo['id']))}','推广员账号',{area: ['700px', '600px']});">推广员账号</a>
						<a class="btn btn-xs btn-primary" href='{:url("store/edit",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>
						<if $vo.delete_time>
							<a class="btn btn-xs btn-success js-ajax-dialog-btn" href="{:url('store/start',array('id'=>$vo['id']))}">开启营业</a>
						<else/>
							<a class="btn btn-xs btn-danger js-ajax-dialog-btn" href="{:url('store/delete',array('id'=>$vo['id']))}">关闭门店</a>
						</if>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>